package com.google.android.material.transformation;

import android.content.Context;
import android.os.Build.VERSION;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewParent;
import androidx.annotation.CallSuper;
import androidx.coordinatorlayout.widget.CoordinatorLayout;
import androidx.coordinatorlayout.widget.CoordinatorLayout.a;
import androidx.core.view.ViewCompat;
import java.util.HashMap;
import java.util.Map;
import o.aqu.e;
import o.aqz;
import o.are;

public class FabTransformationSheetBehavior extends FabTransformationBehavior {
    private Map<View, Integer> ˋ;

    public FabTransformationSheetBehavior(Context context, AttributeSet attributeSet) {
        super(context, attributeSet);
    }

    protected c ˊ(Context context, boolean z) {
        int i;
        if (z) {
            i = e.ॱ;
        } else {
            i = e.ˏ;
        }
        c cVar = new c();
        cVar.ˋ = aqz.ˏ(context, i);
        cVar.ˊ = new are(17, 0.0f, 0.0f);
        return cVar;
    }

    @CallSuper
    protected boolean ˋ(View view, View view2, boolean z, boolean z2) {
        ˏ(view2, z);
        return super.ˋ(view, view2, z, z2);
    }

    private void ˏ(View view, boolean z) {
        ViewParent parent = view.getParent();
        if (parent instanceof CoordinatorLayout) {
            CoordinatorLayout coordinatorLayout = (CoordinatorLayout) parent;
            int childCount = coordinatorLayout.getChildCount();
            if (VERSION.SDK_INT >= 16 && z) {
                this.ˋ = new HashMap(childCount);
            }
            for (int i = 0; i < childCount; i++) {
                View childAt = coordinatorLayout.getChildAt(i);
                Object obj;
                if ((childAt.getLayoutParams() instanceof a) && (((a) childAt.getLayoutParams()).ˋ() instanceof FabTransformationScrimBehavior)) {
                    obj = 1;
                } else {
                    obj = null;
                }
                if (childAt != view && r1 == null) {
                    if (z) {
                        if (VERSION.SDK_INT >= 16) {
                            this.ˋ.put(childAt, Integer.valueOf(childAt.getImportantForAccessibility()));
                        }
                        ViewCompat.setImportantForAccessibility(childAt, 4);
                    } else if (this.ˋ != null && this.ˋ.containsKey(childAt)) {
                        ViewCompat.setImportantForAccessibility(childAt, ((Integer) this.ˋ.get(childAt)).intValue());
                    }
                }
            }
            if (!z) {
                this.ˋ = null;
            }
        }
    }
}
